<template>
  <div class="iframe_wrap">
    <div class="html_service_policy" style="margin-top: 0">
      <iframe id="iframe" :src="this.$route.params.link"
              frameborder="0"></iframe>
    </div>
  </div>
</template>

<script>
  import * as recommend from 'api/recommend'
  import BackNavigation from './mine/navigation.vue'

  export default {
    name: 'about_us',
    components: {
      BackNavigation
    },
    data () {
      return {
        htmlPage: ''
      }
    },
    computed: {
      getVerson () {
//        let packageJson = require('../../../package.json')
//        return packageJson.version
        return '1.0.0'
      }
    },
    methods: {
//      getVerson () {
//        return '1.0.0'
//      }
    },
    created () {
    },
    activated () {
      if(!this.$route.params.link){
        this.$router.back()
        this.$indicator.close()
      }else{
        this.$indicator.open({
          text: '加载中...',
          spinnerType: 'fading-circle'
        })
      }

      let that = this
      let iframe = document.getElementById('iframe')
      iframe.style.height = (document.documentElement.clientHeight || document.body.clientHeight) + 'px'
      iframe.onload = function(){
        that.$indicator.close()
      }
//      if (iframe.readyState === "complete") {
//        this.$indicator.close()
//      }
    },
    deactivated(){
      this.$indicator.close()
    }
  }
</script>

<style lang="scss">
  .iframe_wrap {
    position: fixed;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    background-color: white;
    z-index: 999;
    >div.html_service_policy {
      height: 100%;
      width: 100%;

      >iframe {
        height: 100%;
        width: 100%;
      }
    }
  }
  .mint-indicator{
    z-index: 99999;
    position:fixed;
  }
</style>
